/**
 * @author lteng
 * @time 2022-06-17 20:27:21 
 */
 
package liteng.study.cn.stuscore.service.impl;

import java.util.List;

import liteng.study.cn.stuscore.comm.Page;
import liteng.study.cn.stuscore.dao.EProjectDao;
import liteng.study.cn.stuscore.dao.impl.EProjectDaoImpl;
import liteng.study.cn.stuscore.entity.EProject;
import liteng.study.cn.stuscore.service.EProjectService;

/**
 *
 */
public class EProjectServiceImpl implements EProjectService {

	private EProjectDao eProjectDao = new EProjectDaoImpl();

	@Override
	public void add(EProject eProject) {
		// TODO Auto-generated method stub
		eProjectDao.add(eProject);
	}

	@Override
	public void update(EProject eProject) {
		// TODO Auto-generated method stub
		eProjectDao.update(eProject);
	}

	@Override
	public void delete(EProject eProject) {
		// TODO Auto-generated method stub
		eProjectDao.delete(eProject);

	}

	@Override
	public EProject getOne(int id) {
		// TODO Auto-generated method stub
		EProject eProject = eProjectDao.qryOne(id);
		return eProject;
	}

	@Override
	public boolean isExistEProject(String name) {
		// TODO Auto-generated method stub
		EProject eProject = eProjectDao.qryEProjectByName(name);
		return eProject == null ? false : true;
	}

	@Override
	public EProject getEProjectByName(String name) {
		// TODO Auto-generated method stub
		EProject eProject = eProjectDao.qryEProjectByName(name);
		return eProject;
	}

	@Override
	public Page getPageEProjects(int padeIndex, int PageSize) {
		// TODO Auto-generated method stub
		Page page = eProjectDao.qryEProjects(padeIndex, PageSize);
		return page;
	}

	@Override
	public Page getPageEProjects(int padeIndex, int PageSize, String name) {
		// TODO Auto-generated method stub
		Page page = eProjectDao.qryEProjects(padeIndex, PageSize, name);
		return page;
	}

	@Override
	public List<EProject> getEProjects() {
		// TODO Auto-generated method stub
		List<EProject> eProjects = eProjectDao.qryEProjects();
		return eProjects.size() > 0 ? eProjects : null;
	}

}
